package week04;
import java.util.Scanner;
import java.util.StringTokenizer;

public class Document {

   public static void  main (String[]args) {
      Scanner scan = new Scanner(System.in);
      String sentence = scan.nextLine();

      // default delimiter is " \t\n\r\f"
      String delimiter = " ,\t";
      StringTokenizer tokens = new StringTokenizer(sentence, delimiter);
      System.out.printf("Number of elements: %d\n", tokens.countTokens());

      System.out.println("The tokens are:");
      while (tokens.hasMoreTokens())
         System.out.println(tokens.nextToken());
   }
}
